package com.gmq.chapter01;

/**
 * Created by gmq on 2017/08/08.
 * 线程具有随机性
 *
 * @version 1.0
 * @since 2017/08/08 15:38
 */
public class Test01 {
    public static void main(String[] args) {
        MyThread01 myThread01 = new MyThread01();
        myThread01.setName("myThread");
        myThread01.start();
        // 主线程
        try {
            for (int i = 0; i < 10; i++) {
                int time = (int) (Math.random() * 1000);

                Thread.sleep(time);

                System.out.println("main= " + Thread.currentThread().getName());
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
